package com.uphone.kingmall.utils;

import com.lzy.okgo.model.HttpParams;

import java.io.File;

/**
 * <pre>
 *     author : radish
 *     e-mail : 15703379121@163.com
 *     time   : 2019/3/21
 *     desc   :
 * </pre>
 */
public class HttpParamsUtils {
    HttpParams params = new HttpParams();
    private static HttpParamsUtils paramsUtils = new HttpParamsUtils();

    private HttpParamsUtils() {

    }

    public static HttpParamsUtils getInstance() {
        paramsUtils.clear();
        return paramsUtils;
    }

    public HttpParamsUtils put(String key, String value) {
        params.put(key, value);
        return this;
    }

    public HttpParamsUtils put(String key, File value,String name) {
        params.put(key, value,name);
        return this;
    }

    public HttpParamsUtils put(String key, int value) {
        params.put(key, value);
        return this;
    }

    public HttpParams getParams() {
        return params;
    }

    public void clear() {
        params.clear();
    }

}
